QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top |

Low-Level Routines

Some applications may need more control over progressive downloads, such as control over individual tracks or media, than is possible with the high-level functions for progressive downloads. These applications can use one or both of the low-level functions for progressive downloads described in this section, MakeTrackTimeTable and MakeMediaTimeTable .

MakeMediaTimeTable

The MakeMediaTimeTable function returns a time table for the specified media.

pascal OSErr MakeMediaTimeTable (
                     Media theMedia,
                     long **offsets,
                     TimeValue startTime,
                     TimeValue endTime,
                     TimeValue timeIncrement,
                     short firstDataRefIndex,
                     short lastDataRefIndex,
                     long *retdataRefSkew);
theMedia
Specifies the media for this operation. Your application obtains this identifier from such toolbox functions as NewTrackMedia and GetTrackMedia .
offsets
A handle to an unlocked relocatable memory block allocated by your application. The function returns the time table for the media in this block.
startTime
Specifies the first point of the media to be included in the time table. This time value is expressed in the media's time coordinate system.
endTime
Specifies the last point of the media to be included in the time table. This time value is expressed in the media's time coordinate system.
timeIncrement
The resolution of the time table. The values in a time table are for a points in the media, and these points are separated by the amount of time specified by this parameter. The time value is expressed in the media's time coordinate system.
firstDataRefIndex
An index to the first data reference for the media to be included in the time table. Set this parameter to -1 to include all data references for the media. Set this parameter to 1 to specify the first data reference for the media.
lastDataRefIndex
An index to the last data reference for the media to be included in the time table. The value 1 specifies the first data reference for the media. If the value of the firstDataRefIndex parameter is -1, set this parameter to 0.
retdataRefSkew
The offset to the next row of the time table, in long integers. The next row contains values for the next data reference, as explained below. By adding the value of retdataRefSkew to an offset into the table, you get the offset to the corresponding point for the next data reference.

DISCUSSION

Your application must allocate an unlocked relocatable memory block for the time table to be returned and pass a handle to it in the offsets parameter. The MakeMediaTimeTable function resizes the block to accommodate the time table it returns.

The time table returned by the MakeMediaTimeTable function is a two-dimensional array of long integers, organized as follows:

The number of columns in the table is equal to ( endTime - startTime ) / timeIncrement , rounded up. Because of alignment issues, this value is not always the same as the value of the retdataRefSkew parameter.

When all the data for a movie has been transferred, your application must dispose of the time table created by this function.

MakeTrackTimeTable

The MakeTrackTimeTable function returns a time table for a specified track in a movie.

pascal OSErr MakeTrackTimeTable(
                     Track trackH,
                     long **offsets,
                     TimeValue startTime,
                     TimeValue endTime,
                     TimeValue timeIncrement,
                     short firstDataRefIndex,
                     short lastDataRefIndex,
                     long *retdataRefSkew);
trackH
Specifies the track for the operation. Your application gets this identifier from such toolbox functions as NewMovieTrack and GetMovieTrack .
offsets
A handle to an unlocked relocatable memory block allocated by your application. The function returns the time table for the track in this block.
startTime
Specifies the first point of the track to be included in the time table. This time value is expressed in the movie's time coordinate system.
endTime
Specifies the last point of the track to be included in the time table. This time value is expressed in the movie's time coordinate system.
timeIncrement
The resolution of the time table. The values in a time table are for a points in the track, and these points are separated by the amount of time specified by this parameter. The time value is expressed in the movie's time coordinate system.
firstDataRefIndex
An index to the first data reference for the track to be included in the time table. Set this parameter to -1 to include all data references for the track. Set this parameter to 1 to specify the first data reference for the track.
lastDataRefIndex
An index to the last data reference for the track to be included in the time table. The value 1 specifies the first data reference for the track. If the value of the firstDataRefIndex parameter is -1, set this parameter to 0.
retdataRefSkew
The offset to the next row of the time table, as a long integer. The next row contains values for the next data reference, as explained below. By adding the value of retdataRefSkew to an offset into the table, you get the offset to the corresponding point for the next data reference.

DISCUSSION

Your application must allocate an unlocked relocatable memory block for the time table to be returned and pass a handle to it in the offsets parameter. The MakeTrackTimeTable function resizes the block to accommodate the time table it returns.

The time table returned by the MakeTrackTimeTable function is a two-dimensional array of long integers that is organized as follows:

The number of columns in the table is equal to ( endTime - startTime ) / timeIncrement , rounded up. Because of alignment issues, this value is not always the same as the value of the retdataRefSkew parameter.

If there are track edits for a track, they are reflected in the track's time table.

When all the data for a movie has been transferred, your application must dispose of the time table created by this function.

 


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top |